package model;

/**
 * Team EBE
 * 
 * Package.java represents a model of a the packages used in our diagram.
 * 
 */
public class PackageImpl {
	private String name;
	private int oX, oY, width, height;
	
	public PackageImpl() {
		this.name = null;
	}

	public PackageImpl(String namein){
		this.name = namein;
		this.oX = this.oY = 0;
		this.width = this.height = 350; 
	}
	
	public PackageImpl(int oXIn, int oYIn){
		this.name = "Main Package";
		this.oX = oXIn;
		this.oY = oYIn;
		this.width = this.height = 350; 
	}
	
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getoX() {
		return oX;
	}

	public void setoX(int oX) {
		this.oX = oX;
	}

	public int getoY() {
		return oY;
	}

	public void setoY(int oY) {
		this.oY = oY;
	}

	public int getWidth() {
		return width;
	}

	public void setWidth(int sizeX) {
		this.width = sizeX;
	}

	public int getHeight() {
		return height;
	}

	public void setHeight(int sizeY) {
		this.height = sizeY;
	}

	public String saveString() {
		String s = new String();
		s = "<package>\n";

		s += "<name>" + this.getName() + "</name>\n";
		s += "<x>" + this.getoX() + "</x>\n<y>" + this.getoY()
				+ "</y>\n<height>" + this.getHeight() + "</height>\n<width>"
				+ this.getWidth() + "</width>\n";

		s += "</package>\n";

		return s;
	}
}
